/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LXW
 * Date: 2021-11-28
 * Time: 9:00
 */
class Person {
    public String name;
    public int age;

    public  Person () {
        System.out.println("不带参数的构造方法");
    }
    public  Person (String name) {
        System.out.println("带一个参数的构造方法");
        System.out.println("name"+name);
    }
    public  Person (String name, int age) {
        System.out.println("带二个参数的构造方法");
        System.out.println("name:"+name+"age:"+age);
    }
}
// 编写一个类Calculator,有两个属性num1,num2,这两个数据的值，不能在定义的同时初始化，最后实现加减乘
//除四种运算.
class Calculator {
    public int num1;
    public int num2;
    public void sum() {
        System.out.println(num1 + num2);
    }
    public void sub () {
        System.out.println(num1 - num2);
    }
    public void multiplication () {
        System.out.println(num1 * num2);
    }
    public void division () {
        System.out.println(num1 / num2);
    }
}
public class Demo {
    public static void main(String[] args) {
        MyArraylist myArraylist = new MyArraylist();
        myArraylist.add(0,1);
        myArraylist.add(1,2);
        myArraylist.add(2,3);
        myArraylist.add(3,4);
        myArraylist.display();
    }

    public static void main2(String[] args) {
        Person person = new Person();
        Person person1 = new Person("张三");
        Person person2 =new Person("张三",18);
    }
    public static void main1(String[] args) {
        Calculator calculator = new Calculator();
        calculator.sum();
        calculator.sub();
        calculator.multiplication();
        calculator.division();
    }

}
